package javabase.desginpattern.behavior.handlerchain;

/**
 * 校长
 * @author fance
 * @date 18-4-26 下午2:59
 */
public class President extends Leader {
    public President(String name) {
        super(name);
    }

    @Override
    public void handleRequest(LeaveNode leaveNode) {
        if (leaveNode.getDays() <= 10) { // 小于10 天 可审批
            System.out.println("校长: " + name + "审批 " + leaveNode.getName()
                    + "同学请假 " + leaveNode.getDays() + " 天");
        } else {
            System.out.println("超过10 天 不批准");
        }
    }
}
